<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>测试报告</title>
    <meta name="generator" content="HTMLTestRunner 0.8.2"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">

    <style type="text/css" media="screen">


/* -- css div popup ------------------------------------------------------------------------ */

.popup_window {
    display: none;
    position: relative;
    left: 0px;
    top: 0px;
    /*border: solid #627173 1px; */
    padding: 10px;
    background-color: #99CCFF;
    font-family: "Lucida Console", "Courier New", Courier, monospace;
    text-align: left;
    font-size: 10pt;
    width: 500px;
}
}
/* -- report ------------------------------------------------------------------------ */

#show_detail_line .label {
    font-size: 85%;
    cursor: pointer;
}

#show_detail_line {
    margin: 2em auto 1em auto;
					   
}

#total_row  { font-weight: bold; }						   
.hiddenRow  { display: none; }
.testcase   { margin-left: 2em; }
/* -- ending ---------------------------------------------------------------------- */
#ending {
}


    </style>

</head>
<body>
<script language="javascript" type="text/javascript"><!--
output_list = Array();

/* level - 0:Summary; 1:Failed; 2:All */
function showCase(level) {
    trs = document.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
        tr = trs[i];
        id = tr.id;
        if (id.substr(0,2) == 'ft') {
            if (level < 1) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
        if (id.substr(0,2) == 'pt') {
            if (level > 1) {
                tr.className = '';
            }
            else {
                tr.className = 'hiddenRow';
            }
        }
    }
}


function showClassDetail(cid, count) {
    var id_list = Array(count);
    var toHide = 1;
    for (var i = 0; i < count; i++) {
        tid0 = 't' + cid.substr(1) + '.' + (i+1);
        tid = 'f' + tid0;
        tr = document.getElementById(tid);
        if (!tr) {
            tid = 'p' + tid0;
            tr = document.getElementById(tid);
        }
        id_list[i] = tid;
        if (tr.className) {
            toHide = 0;
        }
    }
    for (var i = 0; i < count; i++) {
        tid = id_list[i];
        if (toHide) {
            document.getElementById('div_'+tid).style.display = 'none'
            document.getElementById(tid).className = 'hiddenRow';
        }
        else {
            document.getElementById(tid).className = '';
        }
    }
}


function showTestDetail(div_id){
    var details_div = document.getElementById(div_id)
    var displayState = details_div.style.display
    // alert(displayState)
    if (displayState != 'block' ) {
        displayState = 'block'
        details_div.style.display = 'block'
    }
    else {
        details_div.style.display = 'none'
    }
}


function html_escape(s) {
    s = s.replace(/&/g,'&amp;');
    s = s.replace(/</g,'&lt;');
    s = s.replace(/>/g,'&gt;');
    return s;
}

/* obsoleted by detail in <div>
function showOutput(id, name) {
    var w = window.open("", //url
                    name,
                    "resizable,scrollbars,status,width=800,height=450");
    d = w.document;
    d.write("<pre>");
    d.write(html_escape(output_list[id]));
    d.write("\n");
    d.write("<a href='javascript:window.close()'>close</a>\n");
    d.write("</pre>\n");
    d.close();
}
*/
-->
</script>

<div class='heading'>
    <h1>测试报告</h1>
    <p class='attribute'><strong>Start Time:</strong> 2020-05-29 18:44:22</p>
    <p class='attribute'><strong>Duration:</strong> 0:00:00.015622</p>
    <p class='attribute'><strong>Status:</strong> <span class="text text-success">Pass <strong>1</strong></span> <span
            class="text text-danger">Failure <strong>1</strong></span></p>

    <p class='description'>测试用例执行情况</p>
</div>


<p id='show_detail_line'>
    <span class="label label-primary" onclick="showCase(0)">Summary</span>
    <span class="label label-danger" onclick="showCase(1)">Failed</span>
    <span class="label label-default" onclick="showCase(2)">All</span>
</p>
<table id='result_table' class="table">
    <thead>
    <tr id='header_row'>
        <th>Test Group/Test case
        </td>
        <th>Count
        </td>
        <th>Pass
        </td>
        <th>Fail
        </td>
        <th>Error
        </td>
        <th>View
        </td>
    </tr>
    </thead>
    <tbody>

    <tr class='text text-danger'>
        <td>classTesting1902.unittest_demo.suite_demo.TestDemo</td>
        <td>2</td>
        <td>1</td>
        <td>1</td>
        <td>0</td>
        <td><a class="btn btn-xs btn-primary" href="javascript:showClassDetail('c1',2)">Detail</a></td>
    </tr>

    <tr id='ft1.1' class='text text-success'>
        <td class='text text-danger'>
            <div class='testcase'>test_case1</div>
        </td>
        <td colspan='5' align='center'>

            <!--css div popup start-->
            <a class="popup_link btn btn-xs btn-default" onfocus='this.blur();'
               href="javascript:showTestDetail('div_ft1.1')">
                fail</a>

            <div id='div_ft1.1' class="popup_window">
                <div style='text-align: right;cursor:pointer'>
                    <a onfocus='this.blur();' onclick="document.getElementById('div_ft1.1').style.display = 'none' ">
                        [x]</a>
                </div>
                <pre>
        
ft1.1: Traceback (most recent call last):
  File "D:\Python\APITest\classTesting1902\unittest_demo\suite_demo.py", line 18, in test_case1
    self.assertEqual(1,2)
AssertionError: 1 != 2
Traceback (most recent call last):
  File "D:\Python\APITest\classTesting1902\unittest_demo\suite_demo.py", line 18, in test_case1
    self.assertEqual(1,2)
AssertionError: 1 != 2


        </pre>
            </div>
            <!--css div popup end-->

        </td>
    </tr>

    <tr id='pt1.2' class='hiddenRow'>
        <td class='text text-success'>
            <div class='testcase'>test_case2</div>
        </td>
        <td colspan='5' align='center'>

            <!--css div popup start-->
            <a class="popup_link btn btn-xs btn-default" onfocus='this.blur();'
               href="javascript:showTestDetail('div_pt1.2')">
                pass</a>

            <div id='div_pt1.2' class="popup_window">
                <div style='text-align: right;cursor:pointer'>
                    <a onfocus='this.blur();' onclick="document.getElementById('div_pt1.2').style.display = 'none' ">
                        [x]</a>
                </div>
                <pre>
        
pt1.2: 

        </pre>
            </div>
            <!--css div popup end-->

        </td>
    </tr>

    </tbody>
    <tfoot>
    <tr id='total_row'>
        <td>Total</td>
        <td>2</td>
        <td class="text text-success">1</td>
        <td class="text text-danger">1</td>
        <td class="text text-warning">0</td>
        <td>&nbsp;</td>
    </tr>
    </tfoot>
</table>

<div id='ending'>&nbsp;</div>

</body>
</html>
